<html>
<head>
<title>the Assembler howto</title>

<link href="../styles/doc.css" rel="stylesheet" type="text/css"></link>
<link class="text/css" href="assembler-style.css" rel="stylesheet"></link>
<script src="library.js" type="text/javascript">
</script>

</head>
<body>


<div class="top-header">
<a href="javascript:allAsCondensed()">
&nabla; Switch Schema Display To Condensed
</a>

<a href="javascript:allAsN3()">
&nabla; Switch Schema Display To N3
</a>

<a href="javascript:printCurrentDisplay()">
&nabla; Print Current Display
</a>
</div>
<br></br>

<h1 id="TOC"><a name="TOC-ID-0"></a>table of contents</h1>
<div>
<div class="toc-H1"><a href="#TOC-ID-0">table of contents</a></div>
<div class="toc-H1"><a href="#TOC-ID-1">introduction</a></div>
<div class="toc-H2"><a href="#TOC-ID-2">overview</a></div>
<div class="toc-H1"><a href="#TOC-ID-3">specifications common to all models</a></div>
<div class="toc-H2"><a href="#TOC-ID-4">content</a></div>
<div class="toc-H2"><a href="#TOC-ID-5">RDB models and Connections</a></div>
<div class="toc-H2"><a href="#TOC-ID-6">file models</a></div>
<div class="toc-H2"><a href="#TOC-ID-7">inference models and reasoners</a></div>
<div class="toc-H3"><a href="#TOC-ID-8">ReasonerFactory</a></div>
<div class="toc-H3"><a href="#TOC-ID-9">rulesets</a></div>
<div class="toc-H2"><a href="#TOC-ID-10">ontology models</a></div>
<div class="toc-H2"><a href="#TOC-ID-11">document managers</a></div>
<div class="toc-H2"><a href="#TOC-ID-12">union models</a></div>
<div class="toc-H2"><a href="#TOC-ID-13">prefix mappings</a></div>
<div class="toc-H2"><a href="#TOC-ID-14">other Assembler directives</a></div>
<div class="toc-H3"><a href="#TOC-ID-15">assembler</a></div>
<div class="toc-H3"><a href="#TOC-ID-16">imports</a></div>
<div class="toc-H1"><a href="#TOC-ID-17">limited RDFS inference</a></div></div>

<h1><a name="TOC-ID-1"></a>introduction</h1>

<p>
This document describes the
vocabulary and effect of the built-in Jena assembler descriptions
for constructing models (and other things). A 
<a href="inside-assemblers.html">companion document</a>
describes the built-in assembler classes and how to write and
integrate your own assemblers. If you just need a quick
guide to the common model specifications, see the
<a href="index.html">assembler quickstart</a>.
</p>

<p>
This document describes how to use the Assembler classes to construct models
-- and other things -- from RDF descriptions that use the
Jena Assembler vocabulary. That vocabulary is available in
<a href="../../vocabularies/assembler.n3">ja-vocabulary.n3</a> as an RDFS schema
with conventional prefix <code>ja</code> for the URI
<code>http://jena.hpl.hp.com/2005/11/Assembler#</code>;
the class <code>JA</code> is its Jena Java rendition.
</p>

<p>The examples used in this document are extracted from
the examples file <a href="examples.n3">examples.n3</a>.
The pieces of RDF/OWL schema are extracted from the
ja-vocabulary file and can be viewed as N3 or in a
condensed notation of the form:
</p>

<pre>
class ClassName [subClassOf SuperClasses]
  domainOf PropertyName [withRange RangeClasses] [Cardinality] ...
</pre>

<p>The property names selected are those which are the "declared
properties" (as per Jena's <code>listDeclaredProperties</code>
method) of the class. Only the most specialised superclasses and
rangeclasses are shown, so (for example) <code>rdf:Resource</code>
typically won't appear.
</p>

<h2><a name="TOC-ID-2"></a>overview</h2>

<p>An Assembler specification is a Resource in some RDF Model. The
properties of that Resource describe what kind of object is to be
assembled and what its components are: for example, an InfModel
is constructed by specifying a base model and a reasoner. The
specifications for the components are themselves Assembler specifications
given by other Resources in the same Model.For example, to specify a
memory model with data loaded from a file:
</p>

<pre>eg:opening-example a ja:MemoryModel 
    ; ja:content [ja:externalContent &lt;file:////home/kers/projects/jena2/doc/assembler/Data/example.n3&gt;] 
    . </pre>

<p>
The rdf:type of eg:model specifies that the constructed Model is to
be a Jena memory-based model. The ja:content property specifies
that the model is to be loaded with the content of the resource
file:Data/example.n3. The content handler guesses from the ".n3" suffix
that this file is to be read using the Jena N3 reader.
</p>

<p>
Unless otherwise specified by an application, Assembler
specifications are interpreted after <i>completion</i> by

<ol>

<li>including the JA schema,
</li><li>including (recursively) the objects of any owl:imports 
and ja:imports statements, and 
</li><li>doing <a href="#limited-rdfs-inference">(limited) RDFS inference</a>.

</li></ol>

(The supplied model is not modified.)
In the example above, eg:model has to be given an explicit type,
but the externalContent bnode is implicitly typed by the domain of
ja:externalContent. In this document, we will usually leave out
inferrable types.
</p>

<p>
We can construct our example model from the specification like this
(you may need to tweak the filename to make this work in your
environment):
</p>

<pre>
Model spec = FileManager.get().loadModel( "examples.n3" );
Resource root = spec.createResource( spec.expandPrefix( "eg:opening-example" ) );
Model m = Assembler.general.openModel( root );
</pre>

<p>The model is constructed from the "root resource",
<code>eg:opening-example</code> in our example. <code>general</code>
knows how to create all the kinds of objects -- not just Models --
that we describe in the next sections.
</p>

<h1><a name="TOC-ID-3"></a>specifications common to all models</h1>

<p>Assembler specifications can describe many kinds of models:
memory, inference, database, ontology, and file-backed.
All of these model specifications share a set of base properties
for attaching content, prefix mappings, and reification modes.
</p>


<div class="surrounding">
<div class="show" id="1001A"><a href="javascript:exchange('1001')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:Loadable <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:initialContent <span class="keyword">withRange</span> ja:Content</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:content <span class="keyword">withRange</span> ja:Content</div></div></div>
<div class="hide" id="1001B"><a href="javascript:exchange('1001')">&nabla; show as condensed</a>
<div class="show-class">ja:Loadable a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:initialContent a rdf:Property
<div class="show-property">; rdfs:domain ja:Loadable</div>
<div class="show-property">; rdfs:range ja:Content</div>
<div>.</div></div>
<div class="show-property">ja:content a rdf:Property
<div class="show-property">; rdfs:domain ja:Loadable</div>
<div class="show-property">; rdfs:range ja:Content</div>
<div>.</div></div></div></div></div>

<div class="surrounding">
<div class="show" id="1002A"><a href="javascript:exchange('1002')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:Model <span class="keyword">subClassOf</span> ja:ContentItem ja:Loadable
<div class="show-property"><span class="keyword">domainOf</span> ja:prefixMapping <span class="keyword">withRange</span> ja:PrefixMapping</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:reificationMode <span class="keyword">withRange</span> ja:ReificationMode</div></div></div>
<div class="hide" id="1002B"><a href="javascript:exchange('1002')">&nabla; show as condensed</a>
<div class="show-class">ja:Model a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:ContentItem</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Loadable</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:prefixMapping a rdf:Property
<div class="show-property">; rdfs:domain ja:Model</div>
<div class="show-property">; rdfs:range ja:PrefixMapping</div>
<div>.</div></div>
<div class="show-property">ja:reificationMode a rdf:Property
<div class="show-property">; rdfs:domain ja:Model</div>
<div class="show-property">; rdfs:range ja:ReificationMode</div>
<div>.</div></div></div></div></div>

<p>All of a model's <code>ja:content</code> property values are
interpreted as specifying <code>Content</code> objects and a single
composite <code>Content</code> object is constructed and used
to initialise the model.
See <a href="#spec-content">Content</a> for the description of Content
specifications. For example:</p>

<pre>eg:sharedContent
    ja:externalContent &lt;http://somewhere/RDF/ont.owl&gt; 
    . 
eg:common-example a ja:MemoryModel 
    ; ja:content eg:sharedContent 
    ; ja:content [ja:externalContent &lt;file:////home/kers/projects/jena2/doc/assembler/Data/A.rdf&gt;] 
    ; ja:content [ja:externalContent &lt;file:////home/kers/projects/jena2/doc/assembler/Data/B.rdf&gt;] 
    . </pre>

<p>
The model constructed for <code>eg:A</code> will be loaded with the
contents of <code>Data/A.n3</code>, <code>Data/B.rdf</code>,
and <code>http://somewhere/RDF/ont.owl</code>. If the model supports
transactions, then the content is loaded inside a transaction; if the
load fails, the transaction is aborted, and a
<code>TransactionAbortedException</code> thrown.
If the content has any prefix mappings, then they are also added
to the model.
</p>

<p>All of a model's <code>ja:prefixMapping</code>, <code>ja:prefix</code>,
and <code>ja:namespace</code> properties are
interpreted as specifying a <code>PrefixMapping</code> object and
a single composite <code>PrefixMapping</code> is constructed and used
to set the prefixes of the model.
See <a href="#spec-prefix-mapping">PrefixMapping</a> for the description of Content
specifications.</p>

<p>A model may have a single <code>ja:reificationMode</code>
property whose value must be one of the constants <code>ja:standard</code>,
<code>ja:convenient</code>, or <code>ja:minimal</code>. The
model's reification mode is set accordingly, if possible.
</p>

<h2><a name="TOC-ID-4"></a><a name="spec-content">content</a></h2>

A Content specification describes content that can be used to fill
models. Content can be external (files and URLs) or literal
(strings in the specification) or quotations (referring to RDF which
is part of the specification).


<div class="surrounding">
<div class="show" id="1003A"><a href="javascript:exchange('1003')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:Content <span class="keyword">subClassOf</span> ja:HasFileManager</div></div>
<div class="hide" id="1003B"><a href="javascript:exchange('1003')">&nabla; show as condensed</a>
<div class="show-class">ja:Content a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:HasFileManager</div>
<div class="show-subclass">.</div></div></div></div>

<div class="surrounding">
<div class="show" id="1004A"><a href="javascript:exchange('1004')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:HasFileManager <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:fileManager <span class="keyword">withRange</span> ja:FileManager</div></div></div>
<div class="hide" id="1004B"><a href="javascript:exchange('1004')">&nabla; show as condensed</a>
<div class="show-class">ja:HasFileManager a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:fileManager a rdf:Property
<div class="show-property">; rdfs:domain ja:HasFileManager</div>
<div class="show-property">; rdfs:range ja:FileManager</div>
<div>.</div></div></div></div></div>

<p>
A <code>ja:Content</code> specification may have zero or more
<code>ja:externalContent</code> property values. These are URI
resources naming an external (file or http etc) RDF object.
The constructed Content object contains the union of the values of
all such resources. For example:
</p>

<pre>eg:external-content-example
    ja:externalContent &lt;file:////home/kers/projects/jena2/doc/assembler/Data/C.owl&gt;,
        &lt;http://jena.hpl.hp.com/some-jena-data.rdf&gt; 
    . </pre>

<p>
The external content is located using a <code>FileManager</code>. If
the <code>Content</code> resource has a <code>ja:fileManager</code>
property, then the <code>FileManager</code> described by that resource
is used. Otherwise, if the <code>ContentAssembler</code> assembling
this specification was constructed with a <code>FileManager</code>
argument, that <code>FileManager</code> is used. Otherwise, the
default <code>FileManager</code>, <code>FileManager.get()</code>,
is used.
</p>

<p>The string literal value of the any <code>ja:literalContent</code>
properties is interpreted as RDF in an appropriate language. The constructed
Content object contains that RDF. The language is either specified by an
explicit <code>ja:contentEncoding</code> property value, or guessed from
the content of the string. The only encodings permitted are "N3" and "RDF/XML".
For example:
</p>

<pre>eg:literal-content-example
    ja:literalContent "_:it dc:title 'Interesting Times'" 
    . </pre>

<p>The literal content is wrapped so that prefix declarations for
<b>rdf</b>, <b>rdfs</b>, <b>owl</b>, <b>dc</b>, and <b>xsd</b>
apply before interpretation.</p>

<p>The property values of any <code>ja:quotedContent</code> properties
should be resources. The subgraphs rooted at those resources (using the
algorithm from <code>ResourceUtils.reachableClosure()</code>) are added
to the content.
</p>

<h2><a name="TOC-ID-5"></a>RDB models and Connections</h2>

<p>
The description of an RDB model requires its name and a description of
the JDBC connection for the database the model is in. For example:
</p>

<pre>eg:database-example
    ja:connection eg:connection 
    ; ja:modelName "Thunderbird3" 
    . 
eg:connection
    ja:dbType "MySQL" 
    ; ja:dbURL &lt;jdbc:mysql://localhost/test&gt; 
    ; ja:dbUser "cjd" 
    . </pre>


<div class="surrounding">
<div class="show" id="1005A"><a href="javascript:exchange('1005')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:RDBModel <span class="keyword">subClassOf</span> ja:Connectable ja:NamedModel</div></div>
<div class="hide" id="1005B"><a href="javascript:exchange('1005')">&nabla; show as condensed</a>
<div class="show-class">ja:RDBModel a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:Connectable</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:connection; owl:cardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:NamedModel</div>
<div class="show-subclass">.</div></div></div></div>

<div class="surrounding">
<div class="show" id="1006A"><a href="javascript:exchange('1006')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:Connectable <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:connection <span class="keyword">withRange</span> ja:Connection</div></div></div>
<div class="hide" id="1006B"><a href="javascript:exchange('1006')">&nabla; show as condensed</a>
<div class="show-class">ja:Connectable a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:connection a rdf:Property
<div class="show-property">; rdfs:domain ja:Connectable</div>
<div class="show-property">; rdfs:range ja:Connection</div>
<div>.</div></div></div></div></div>

<div class="surrounding">
<div class="show" id="1007A"><a href="javascript:exchange('1007')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:NamedModel <span class="keyword">subClassOf</span> ja:Model
<div class="show-property"><span class="keyword">domainOf</span> ja:modelName <span class="keyword">cardinality</span> 1</div></div></div>
<div class="hide" id="1007B"><a href="javascript:exchange('1007')">&nabla; show as condensed</a>
<div class="show-class">ja:NamedModel a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:modelName; owl:cardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Model</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:modelName a rdf:Property
<div class="show-property">; rdfs:domain ja:NamedModel</div>
<div>.</div></div></div></div></div>

<p><code>ja:RDBModel</code> is a subclass of <code>ja:NamedModel</code>
and shares the <code>ja:ModelName</code> property value naming the model
within the database.</p>

<p>The mandatory unique property value of <code>ja:connection</code>
specifies the connection to the database to be used.
</p>

<p>The description of a connection requires the database name and type
and the user name and password. If the username and password are not
specified, <code>Assembler.general</code> will default them, normally
to the values of the system properties <code>jena.dbUser</code> and
<code>jena.dbPassword</code>.
</p>


<div class="surrounding">
<div class="show" id="1008A"><a href="javascript:exchange('1008')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:Connection <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:dbTypeProperty <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbPasswordProperty <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbType <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbURL <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbPassword <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbURLProperty <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbUserProperty <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbClass <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbClassProperty <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:dbUser <span class="keyword">maxCardinality</span> 1</div></div></div>
<div class="hide" id="1008B"><a href="javascript:exchange('1008')">&nabla; show as condensed</a>
<div class="show-class">ja:Connection a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbType; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbClass; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbTypeProperty; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbURL; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbClassProperty; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbUser; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbPassword; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbUserProperty; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbPasswordProperty; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:dbURLProperty; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:dbTypeProperty a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbPasswordProperty a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbType a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbURL a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbPassword a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbURLProperty a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbUserProperty a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbClass a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbClassProperty a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div>
<div class="show-property">ja:dbUser a rdf:Property
<div class="show-property">; rdfs:domain ja:Connection</div>
<div>.</div></div></div></div></div>

<p>The <code>ja:dbURL</code> property value specifies the
URL of the database to be connected to. If it is ommitted, the
<code>ja:dbURLProperty</code> value is the name of a Java system
property whose value is the URL of the database.</p>

<p>The <code>ja:dbType</code> property value
specifies the type of the database as a string. If it is omitted, the
<code>ja:dbTypeProperty</code> value is the name of a Java
system property whose value is the database type.</p>

<p>The unique <code>ja:dbUser</code> property value is a string
literal whose value is the name of the user connecting to the
database. If it is omitted, the value of the <code>ja:dbUserProperty</code>
is the name of a Java system property containing the user name.</p>

<p>The unique <code>ja:dbPassword</code> property value is the
password of the user connecting to the database. If it is omitted,
the value of the <code>ja:dbPasswordProperty</code> is the name
of a Java system property whose value is the password.</p>

<h2><a name="TOC-ID-6"></a>file models</h2>

<p>A FileModel specification builds a memory model that is backed by a file.
By "backed", we mean that the model is loaded from that file and written
back to the file when (if) it is closed. Furthermore, the model (weakly)
supports transactions.
</p>

<pre>eg:fileModel-example-1
    ja:directory &lt;file:///tmp&gt; 
    ; ja:modelName "simple" 
    . </pre>

<p>
Here, the model is read from (and written to) the file <code>/tmp/simple</code>.
Directory names are given as resources (not literals) and of course file names
are system dependant -- this is what one might see on a Unix system. If the
directory name is to be shared by several different FileModels, it can be useful
to give it a namespace prefix so that it can be changed in one place as
necessary.
</p>

<pre>eg:fileModel-example-2
    ja:directory &lt;file:////home/kers/projects/jena2/doc/assembler/FileModels&gt; 
    ; ja:mapName ja:true 
    ; ja:modelName "http://somewhere.org/stuff.n3" 
    . </pre>

<p>
Model names can be <i>mapped</i> to allow them to be URIs without the
/s in URIs being taken as directory separators. Here, the base file name
will be <code>FileModels/http_C_S_Ssomewhere.org_Sstuff.n3</code>. The
encoding is not pretty, but is sufficient for simple URIs.
</p>


<div class="surrounding">
<div class="show" id="1009A"><a href="javascript:exchange('1009')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:FileModel <span class="keyword">subClassOf</span> ja:NamedModel
<div class="show-property"><span class="keyword">domainOf</span> ja:fileEncoding <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:directory <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:mapName <span class="keyword">maxCardinality</span> 1</div></div></div>
<div class="hide" id="1009B"><a href="javascript:exchange('1009')">&nabla; show as condensed</a>
<div class="show-class">ja:FileModel a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:mapName; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:directory; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:fileEncoding; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:NamedModel</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:fileEncoding a rdf:Property
<div class="show-property">; rdfs:domain ja:FileModel</div>
<div>.</div></div>
<div class="show-property">ja:directory a rdf:Property
<div class="show-property">; rdfs:domain ja:FileModel</div>
<div>.</div></div>
<div class="show-property">ja:mapName a rdf:Property
<div class="show-property">; rdfs:domain ja:FileModel</div>
<div>.</div></div></div></div></div>

<p>The <code>ja:directory</code> property specifies the directory in which the
model file is located. The <code>ja:modelName</code> property specifies the name of
the file within that directory.
</p>

<p>The optional unique property <code>ja:fileEncoding</code> has as its value
a string which is the name of the encoding language of the model (ie one of
RDF/XML or N3, etc). If it is omitted, the language is guessed from the suffix
of the filename (as per <code>FileUtils.guessLang()</code>).
</p>

<p>If the optional unique property <code>ja:mapName</code> has the value
<code>ja:true</code>, then the name of the model is <i>mapped</i> by replacing
any _, /, or : characters by the escape sequences __, _S, or _C. This
translation (which is the same one done by <code>FileGraphMaker</code> for
<code>FileModelMaker</code>) allows URIs to be used as model names without
conflicting with the filesystems use of / characters.
</p>

<h2><a name="TOC-ID-7"></a>inference models and reasoners</h2>

<p>Inference models are specified by supplying a description of the
reasoner that is used by the model and (optionally) a base model to
reason over. For example:</p>

<pre>eg:inference-example
    ja:baseModel [a ja:MemoryModel] 
    ; ja:reasoner [ja:reasonerURL &lt;http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner&gt;] 
    . </pre>

<p>describes an inference model that uses RDFS reasoning. The
<i>reasonerURL</i> property value is the URI used to identify the
reasoner (it is the value of the Jena constant
<code>RDFSRuleReasonerFactory.URI</code>). The base model is
specified as a memory model; if it is left out, an empty memory
model is used. Of course, you can specify a database model as a base
model:
</p>

<pre>eg:database-example
    ja:connection eg:connection 
    ; ja:modelName "Thunderbird3" 
    . 
eg:connection
    ja:dbType "MySQL" 
    ; ja:dbURL &lt;jdbc:mysql://localhost/test&gt; 
    ; ja:dbUser "cjd" 
    . 
eg:db-inference-example
    ja:baseModel eg:database-example 
    ; ja:reasoner [ja:reasonerURL &lt;http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner&gt;] 
    . </pre>

<p>The same reasoner as used as in the previous example, but now the
base model is a database specified in the same way as our earlier example.
</p>

<p>Because Jena's access to external reasoners goes through the same API as
for its internal reasoners, you can access a DIG reasoner (such as Pellet
running as a server) using an Assembler specification:

<pre>eg:external-inference-example
    ja:reasoner [&lt;http://jena.hpl.hp.com/2003/JenaReasoner#extReasonerURL&gt;
    &lt;http://localhost:2004/&gt; 
    ; ja:reasonerURL &lt;http://jena.hpl.hp.com/2003/DIGReasoner&gt;] 
    . </pre>

If there's a DIG server running locally on port 2004, this specification
will create a DIG inference model that uses it.
</p>

<p>The internal rule reasoner can be supplied with rules written inside
the specification, or outside from some resource (file or http: URL):

<pre>eg:rule-inference-example
    ja:reasoner [ja:rule "[r1: (?x my:P ?y) -&gt; (?x rdf:type my:T)]"] 
    . </pre>

This reasoner will infer a type declaration from a use of a property. (The
prefix <i>my</i> will have to be known to the rule parser, of course.)

</p>


<div class="surrounding">
<div class="show" id="1010A"><a href="javascript:exchange('1010')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:InfModel <span class="keyword">subClassOf</span> ja:Model
<div class="show-property"><span class="keyword">domainOf</span> ja:reasoner <span class="keyword">withRange</span> ja:ReasonerFactory <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:baseModel <span class="keyword">withRange</span> ja:Model <span class="keyword">maxCardinality</span> 1</div></div></div>
<div class="hide" id="1010B"><a href="javascript:exchange('1010')">&nabla; show as condensed</a>
<div class="show-class">ja:InfModel a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:reasoner; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:baseModel; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Model</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:reasoner a rdf:Property
<div class="show-property">; rdfs:domain ja:InfModel</div>
<div class="show-property">; rdfs:range ja:ReasonerFactory</div>
<div>.</div></div>
<div class="show-property">ja:baseModel a rdf:Property
<div class="show-property">; rdfs:domain ja:InfModel</div>
<div class="show-property">; rdfs:range ja:Model</div>
<div>.</div></div></div></div></div>

<div class="surrounding">
<div class="show" id="1011A"><a href="javascript:exchange('1011')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:HasRules <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:rule</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:rulesFrom</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:rules <span class="keyword">withRange</span> ja:RuleSet</div></div></div>
<div class="hide" id="1011B"><a href="javascript:exchange('1011')">&nabla; show as condensed</a>
<div class="show-class">ja:HasRules a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:rule a rdf:Property
<div class="show-property">; rdfs:domain ja:HasRules</div>
<div>.</div></div>
<div class="show-property">ja:rulesFrom a rdf:Property
<div class="show-property">; rdfs:domain ja:HasRules</div>
<div>.</div></div>
<div class="show-property">ja:rules a rdf:Property
<div class="show-property">; rdfs:domain ja:HasRules</div>
<div class="show-property">; rdfs:range ja:RuleSet</div>
<div>.</div></div></div></div></div>

<p>An InfModel's <code>ja:baseModel</code> property value specifies
the base model for the inference model; if omitted, an empty memory model is
used. </p>

<p>An InfModel's <code>ja:ReasonerFactory</code> property value specifies
the Reasoner for this inference model; if omitted, a GenericRuleReasoner
is used.
</p>

<p>A Reasoner's optional <code>ja:schema</code> property
specifies a Model which contains the schema for the reasoner to
be bound to. If omitted, no schema is used.
</p>

<p>If the Reasoner is a GenericRuleReasoner, it may have any of the
RuleSet properties <code>ja:rules</code>, <code>ja:rulesFrom</code>,
or <code>ja:rule</code>. The rules of the implied <code>RuleSet</code>
are added to the <code>Reasoner</code>.
</p>

<h3><a name="TOC-ID-8"></a>ReasonerFactory</h3>

<p>
A ReasonerFactory can be specified by URL or by class name (but not both).
</p>


<div class="surrounding">
<div class="show" id="1012A"><a href="javascript:exchange('1012')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:ReasonerFactory <span class="keyword">subClassOf</span> ja:HasRules
<div class="show-property"><span class="keyword">domainOf</span> ja:reasonerClass</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:reasonerURL</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:schema <span class="keyword">withRange</span> ja:Model</div></div></div>
<div class="hide" id="1012B"><a href="javascript:exchange('1012')">&nabla; show as condensed</a>
<div class="show-class">ja:ReasonerFactory a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:ReasonerURL; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:HasRules</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:reasonerClass a rdf:Property
<div class="show-property">; rdfs:domain ja:ReasonerFactory</div>
<div>.</div></div>
<div class="show-property">ja:reasonerURL a rdf:Property
<div class="show-property">; rdfs:domain ja:ReasonerFactory</div>
<div>.</div></div>
<div class="show-property">ja:schema a rdf:Property
<div class="show-property">; rdfs:domain ja:ReasonerFactory</div>
<div class="show-property">; rdfs:range ja:Model</div>
<div>.</div></div></div></div></div>

<p>
If the optional unique property <code>ja:reasonerURL</code> is specified,
then its resource value is the URI of a reasoner in the Jena reasoner
registry; the reasoner is the one with the given URI.
</p>

<p>
If the optional property <code>ja:schema</code> is specified, then
the models specified by all the schema properties are unioned and
any reasoner produced by the factory will have that union bound in
as its schema (using the <code>Reasoner::bindSchema()</code> method).
</p>

<p>
If the optional unique property <code>ja:reasonerClass</code> is specified,
its value names a class which implements <code>ReasonerFactory</code>. That
class is loaded and an instance of it used as the factory.
</p>

<p>
The class may be named by the lexical form of a literal, or by a URI
with the (fake) "java:" scheme.
</p>

<p>
If the class has a method <code>theInstance</code>, that method is called
to supply the <code>ReasonerFactory</code> instance to use. Otherwise,
a new instance of that class is constructed. Jena's reasoner factories come
equipped with this method; for other factories, see the documentation.
</p>

<h3><a name="TOC-ID-9"></a>rulesets</h3>

<p>
A <code>RuleSet</code> specification allows rules (for ReasonerFactories)
to be specified inline, elsewhere in the specification model, or in an external
resource.
</p>


<div class="surrounding">
<div class="show" id="1013A"><a href="javascript:exchange('1013')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:RuleSet <span class="keyword">subClassOf</span> ja:HasRules</div></div>
<div class="hide" id="1013B"><a href="javascript:exchange('1013')">&nabla; show as condensed</a>
<div class="show-class">ja:RuleSet a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:HasRules</div>
<div class="show-subclass">.</div></div></div></div>

<p>The optional repeatable property <code>ja:rule</code> has as its value
a literal string which is the text of a Jena rule or rules. All those rules
are added to the <code>RuleSet</code>.</p>

<p>The optional repeatable property <code>ja:rulesFrom</code> has as its value
a resource whose URI identifies a file or other external entity that can be
loaded as Jena rules. All those rules are added to the <code>RuleSet</code>.</p>

<p>The optional repeatable property <code>ja:rules</code> has as its value
a resource which identifies another <code>RuleSet</code> in the specification model.
All those rules from that <code>RuleSet</code> are added to this <code>RuleSet</code>.</p>

<h2><a name="TOC-ID-10"></a>ontology models</h2>

<p>
Ontology models can be specified in several ways. The simplest is to use
the name of an OntModelSpec from the Java OntModelSpec class:
</p>

<pre>eg:simple-ont-example
    ja:ontModelSpec ja:OWL_DL_MEM_RULE_INF 
    . </pre>

<p>This constructs an <code>OntModel</code> with an empty base model
and using the OWL_DL language and the full rule reasoner. All of the
OntModelSpec constants in the Jena implementation are available in this way.
A base model can be specified:
</p>

<pre>eg:base-ont-example
    ja:baseModel [a ja:MemoryModel 
    ; ja:content [ja:externalContent &lt;http://jena.hpl.hp.com/some-jena-data.rdf&gt;]] 
    . </pre>

<p>The OntModel has a base which is a memory model loaded with the contents
of <i>http://jena.hpl.hp.com/some-jena-data.rdf</i>. Since the ontModelSpec
was omitted, it defaults to <code>OWL_MEM_RDFS_INF</code> - the same default
as <code>ModelFactory.createOntologyModel()</code>.
</p>


<div class="surrounding">
<div class="show" id="1014A"><a href="javascript:exchange('1014')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:OntModel <span class="keyword">subClassOf</span> ja:UnionModel ja:InfModel
<div class="show-property"><span class="keyword">domainOf</span> ja:ontModelSpec <span class="keyword">withRange</span> ja:OntModelSpec</div></div></div>
<div class="hide" id="1014B"><a href="javascript:exchange('1014')">&nabla; show as condensed</a>
<div class="show-class">ja:OntModel a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:UnionModel</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:InfModel</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:ontModelSpec a rdf:Property
<div class="show-property">; rdfs:domain ja:OntModel</div>
<div class="show-property">; rdfs:range ja:OntModelSpec</div>
<div>.</div></div></div></div></div>

<div class="surrounding">
<div class="show" id="1015A"><a href="javascript:exchange('1015')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:OntModelSpec <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:importSource <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:reasonerFactory <span class="keyword">withRange</span> ja:ReasonerFactory <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:documentManager <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:ontLanguage <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:likeBuiltinSpec</div></div></div>
<div class="hide" id="1015B"><a href="javascript:exchange('1015')">&nabla; show as condensed</a>
<div class="show-class">ja:OntModelSpec a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:like; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:reasonerFactory; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:importSource; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:documentManager; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:ontLanguage; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:importSource a rdf:Property
<div class="show-property">; rdfs:domain ja:OntModelSpec</div>
<div>.</div></div>
<div class="show-property">ja:reasonerFactory a rdf:Property
<div class="show-property">; rdfs:domain ja:OntModelSpec</div>
<div class="show-property">; rdfs:range ja:ReasonerFactory</div>
<div>.</div></div>
<div class="show-property">ja:documentManager a rdf:Property
<div class="show-property">; rdfs:domain ja:OntModelSpec</div>
<div>.</div></div>
<div class="show-property">ja:ontLanguage a rdf:Property
<div class="show-property">; rdfs:domain ja:OntModelSpec</div>
<div>.</div></div>
<div class="show-property">ja:likeBuiltinSpec a rdf:Property
<div class="show-property">; rdfs:domain ja:OntModelSpec</div>
<div>.</div></div></div></div></div>
<p><code>OntModel</code> is a subclass of <code>InfModel</code>, and the
<code>ja:baseModel</code> property means the same thing.
</p>

<p>The <code>OntModelSpec</code> property value is a resource,
interpreted as an OntModelSpec description based on its name
and the value of the appropriate properties:

<ul>
<li><code>ja:likeBuiltinSpec</code>:
The value of this optional unique property must be a JA resource whose 
local name is the same as the name of an OntModelSpec constant (as in
the simple case above). This is the basis for the OntModelSpec constructed
from this specification. If absent, then <code>OWL_MEM_RDFS_INF</code>
is used. To build an OntModelSpec with no inference, use eg 
<code>ja:likeBuiltinSpec ja:OWL_MEM</code>.
</li>

<li><code>ja:importSource</code>:
The value of this optional unique property is a <code>ModelSource</code>
description which describes where imports are obtained from. A <code>ModelSource</code>
my be of class <code>ja:ModelSource</code>, for which memory models are constructed,
or a <code>ja:RDBModelSource</code> with a <code>ja:connection</code> property,
for which models are constructed in the specified database.
</li>

<li><code>ja:documentManager</code>:
This value of this optional unique property is a DocumentManager specification.
If absent, the default document manager is used.

</li><li><code>ja:reasonerFactory</code>:
The value of this optional unique property is the ReasonerFactory resource
which will be used to construct this OntModelSpec's reasoner. A
<code>reasonerFactory</code> specification is the same as an InfModel's
<code>reasoner</code> specification (the different properties are required
for technical reasons).
</li>

<li><code>ja:reasonerURL</code>: as a special case of <code>reasonerFactory</code>,
a reasoner may be specified by giving its URL as the object of the optional
unique <code>reasonerURL</code> property. It is not permitted to supply
both a <code>reasonerURL</code> and <code>reasonerFactory</code> properties.
</li>

<li><code>ja:ontLanguage</code>:
The value of this optional unique property is one of the values in the
<code>ProfileRegistry</code> class which identifies the ontology language
of this <code>OntModelSpec</code>:

    <ul>
    <li>OWL: http://www.w3.org/2002/07/owl#
    </li><li>OWL DL: http://www.w3.org/TR/owl-features/#term_OWLDL
    </li><li>OWL Lite: http://www.w3.org/TR/owl-features/#term_OWLLite
    </li><li>RDFS: http://www.w3.org/2000/01/rdf-schema#
    </li><li>DAML: http://www.daml.org/2001/03/daml+oil#
    </li></ul>

</li>
</ul>
</p>

<p>Any unspecified properties have default values, normally taken
from those of <code>OntModelSpec.OWL_MEM_RDFS_INF</code>. However,
if the OntModelSpec resource is in the JA namespace, and its local
name is the same as that of an OntModelSpec constant, then that
constant is used as the default value.
</p>

<h2><a name="TOC-ID-11"></a>document managers</h2>

<p>An <code>OntDocumentManager</code> can be specified by a
<code>ja:DocumentManager</code> specification which describes the
<code>OntDocumentManager</code>'s file manager and policy settings.
</p>

<pre>eg:mapper
    lm:mapping [lm:altName "file:etc/foo.n3" 
    ; lm:name "file:foo.n3"] 
    . 
eg:document-manager-example
    ja:fileManager [ja:locationMapper eg:mapper] 
    ; ja:meta [ dm:altURL &lt;http://localhost/RDF/my-alt.rdf&gt;] 
    . </pre>

<p>In this example, <code>eg:document-manager-example</code> is a
<code>ja:DocumentManager</code> specification. It has its own
<code>FileManager specification</code>, the object of the
<code>ja:fileManager property</code>; that <code>FileManager</code>
has a location mapper, <code>eg:mapper</code>, that maps a single
filename.</p>

<p>
The document manager also has an additional property to link it to
document manager meta-data: the sub-model of the assembler specification
reachable from <code>eg:document-manager-example</code> is passed to
the document manager when it is created. For the meanings of the
<code>dm:</code> properties, see the Jena ontology documentation and
the ontology.rdf ontology.
</p>


<div class="surrounding">
<div class="show" id="1016A"><a href="javascript:exchange('1016')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:DocumentManager <span class="keyword">subClassOf</span> ja:HasFileManager
<div class="show-property"><span class="keyword">domainOf</span> ja:policyPath <span class="keyword">maxCardinality</span> 1</div></div></div>
<div class="hide" id="1016B"><a href="javascript:exchange('1016')">&nabla; show as condensed</a>
<div class="show-class">ja:DocumentManager a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:policyPath; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:fileManager; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:fileManager; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:HasFileManager</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:policyPath a rdf:Property
<div class="show-property">; rdfs:domain ja:DocumentManager</div>
<div>.</div></div></div></div></div>

<p>
The <code>ja:fileManager</code> property value, if present, has as its object
a <code>ja:FileManager</code> specification; the constructed document manager
is given a new file manager constructed from that specification. If there is no
<code>ja:fileManager</code> property, then the default <code>FileManager</code>
is used.
</p>

<p>The <code>ja:policyPath</code> property value, if present, should be a string
which is a path to policy files as described in the Jena ontology documentation.
If absent, the usual default path is applied.
</p>

<p>If the sub-model of the assembler specification reachable from the
DocumentManager resource contains any OntDocumentManager DOC_MGR_POLICY
or ONTOLOGY_SPEC objects, they will be interpreted by the constructed
document manager object.
</p>


<div class="surrounding">
<div class="show" id="1017A"><a href="javascript:exchange('1017')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:FileManager <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:locationMapper <span class="keyword">withRange</span> ja:LocationMapper <span class="keyword">maxCardinality</span> 1</div></div></div>
<div class="hide" id="1017B"><a href="javascript:exchange('1017')">&nabla; show as condensed</a>
<div class="show-class">ja:FileManager a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:locationMapper; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:locationMapper a rdf:Property
<div class="show-property">; rdfs:domain ja:FileManager</div>
<div class="show-property">; rdfs:range ja:LocationMapper</div>
<div>.</div></div></div></div></div>

<p>A <code>ja:FileManager</code> object may have a <code>ja:locationMapper</code>
property value which identifies the specification of a <code>LocationMapper</code>
object initialising that file manager.
</p>


<div class="surrounding">
<div class="show" id="1018A"><a href="javascript:exchange('1018')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:LocationMapper <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> lm:mapping <span class="keyword">maxCardinality</span> 1</div></div></div>
<div class="hide" id="1018B"><a href="javascript:exchange('1018')">&nabla; show as condensed</a>
<div class="show-class">ja:LocationMapper a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty lm:mapping; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">lm:mapping a rdf:Property
<div class="show-property">; rdfs:domain ja:LocationMapper</div>
<div>.</div></div></div></div></div>

<p>
A <code>ja:LocationMapper</code> object may have <code>lm:mapping</code>
property values, describing the location mapping, as described in the
FileManager documentation. (Note that the vocabulary for those items is
in a different namespace than the JA properties and classes.)</p>

<h2><a name="TOC-ID-12"></a>union models</h2>

<p>
Union models can be constructed from any number of submodels and a
single <i>root</i> model. The root model is the one written to when
the union model is updated; the submodels are untouched.
</p>


<div class="surrounding">
<div class="show" id="1019A"><a href="javascript:exchange('1019')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:UnionModel <span class="keyword">subClassOf</span> ja:Model
<div class="show-property"><span class="keyword">domainOf</span> ja:rootModel <span class="keyword">withRange</span> ja:Model <span class="keyword">maxCardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:subModel <span class="keyword">withRange</span> ja:Model</div></div></div>
<div class="hide" id="1019B"><a href="javascript:exchange('1019')">&nabla; show as condensed</a>
<div class="show-class">ja:UnionModel a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:rootModel; owl:maxCardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:Model</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:rootModel a rdf:Property
<div class="show-property">; rdfs:domain ja:UnionModel</div>
<div class="show-property">; rdfs:range ja:Model</div>
<div>.</div></div>
<div class="show-property">ja:subModel a rdf:Property
<div class="show-property">; rdfs:domain ja:UnionModel</div>
<div class="show-property">; rdfs:range ja:Model</div>
<div>.</div></div></div></div></div>

<p>
If the single <code>ja:rootModel</code> property is present, its value
describes a model to use as the root model of the union. All updates to the
union are directed to this root model. If no root model is supplied, the
union is given an <i>immutable</i>, <i>empty</i> model as its root.
</p>

<p>
Any <code>ja:subModel</code> property values have objects describing
the remaining sub-models of the union. The order of the sub-models in the
union is <i>undefined</i> (which is why there's a special rootModel
property).
</p>

<h2><a name="TOC-ID-13"></a>prefix mappings</h2>

<p>The PrefixMappings of a model may be set from PrefixMapping specifications.
</p>


<div class="surrounding">
<div class="show" id="1020A"><a href="javascript:exchange('1020')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:PrefixMapping <span class="keyword">subClassOf</span> ja:Object
<div class="show-property"><span class="keyword">domainOf</span> ja:includes <span class="keyword">withRange</span> ja:PrefixMapping</div></div></div>
<div class="hide" id="1020B"><a href="javascript:exchange('1020')">&nabla; show as condensed</a>
<div class="show-class">ja:PrefixMapping a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf ja:Object</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:includes a rdf:Property
<div class="show-property">; rdfs:domain ja:PrefixMapping</div>
<div class="show-property">; rdfs:range ja:PrefixMapping</div>
<div>.</div></div></div></div></div>

<div class="surrounding">
<div class="show" id="1021A"><a href="javascript:exchange('1021')">&nabla; show as N3</a>
<div class="show-class"><span class="keyword">class</span> ja:SinglePrefixMapping <span class="keyword">subClassOf</span> ja:PrefixMapping
<div class="show-property"><span class="keyword">domainOf</span> ja:namespace <span class="keyword">cardinality</span> 1</div>
<div class="show-property"><span class="keyword">domainOf</span> ja:prefix <span class="keyword">cardinality</span> 1</div></div></div>
<div class="hide" id="1021B"><a href="javascript:exchange('1021')">&nabla; show as condensed</a>
<div class="show-class">ja:SinglePrefixMapping a rdfs:Class
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:namespace; owl:cardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf [owl:onProperty ja:prefix; owl:cardinality 1]</div>
<div class="show-subclass"> ; rdfs:subClassOf ja:PrefixMapping</div>
<div class="show-subclass">.</div>
<div class="show-property">ja:namespace a rdf:Property
<div class="show-property">; rdfs:domain ja:SinglePrefixMapping</div>
<div>.</div></div>
<div class="show-property">ja:prefix a rdf:Property
<div class="show-property">; rdfs:domain ja:SinglePrefixMapping</div>
<div>.</div></div></div></div></div>

<p>The <code>ja:includes</code> property allows a PrefixMapping to include the
content of other specified PrefixMappings.
</p>

<p>The <code>ja:prefix</code> and <code>ja:namespace</code> properties
allow the construction of a single element of a prefix mapping by specifying
the prefix and namespace of the mapping.</p>

<h2><a name="TOC-ID-14"></a>other Assembler directives</h2>

<p>There are two more <code>Assembler</code> directives that can be
used in an Assembler specification: the <i>assembler</i> and <i>imports</i>
directives.</p>

<h3><a name="TOC-ID-15"></a>assembler</h3>

<p>A specification may contain statements of the form:

<blockquote>
<code>someResource ja:assembler "some.Assembler.class.name"</code>
</blockquote>

</p><p>
When <code>someResource</code> is used as the type of a root object,
the AssemblerGroup that processes the description will use an instance
of the Java class named by the object of the statement. That class
must implement the <code>Assembler</code> interface. See
<a href="#loading-assembler-classes">loading assembler classes</a>
for more details.
</p>

<p>Similarly, statements of the form:

<blockquote>
<code>someResource ja:loadClass "some.class.name"</code>
</blockquote>

will cause the named class to be loaded (but not treated as assemblers).
</p>

<h3><a name="TOC-ID-16"></a>imports</h3>

<p>If a specification contains statements of the form:

<blockquote>
<code>anyResource owl:imports someURL</code>
</blockquote>

or, equivalently,

<blockquote>
<code>anyResource ja:imports someURL</code>
</blockquote>

then the specification is regarded as also containing the contents of the
RDF at <code>someURL</code>. That RDF may in turn contain
<code>imports</code> referring to other RDF.
</p>

<h1><a name="TOC-ID-17"></a><a name="limited-rdfs-inference">limited RDFS inference</a></h1>

<p>
The Assembler engine uses limited RDFS inference to complete the model
it is given, so that the spec-writer does not need to write excessive and
redundant RDF. (It does not use the usual Jena reasoners because this
limited once-off reasoning has been faster.) The inference steps
are:

<ul>
<li>add all the classes from the JA schema.
</li><li>do subclass closure over all the classes.
</li><li>do domain and range inference.
</li><li>do simple intersection inference: if X is an instance of
    <i>intersection A B C ...</i>, then X is an instance of A, B,
    C ... (and their supertypes).
</li></ul>

This is sufficient for closed-world assembling. Other parts of the
JA schema -- eg, cardinality constraints -- are hard-coded into the
individual assemblers. 
</p>



</body></html>